﻿@model Bieb.Web.Models.Stories.ViewStoryModel

@{
    ViewBag.Title = "Details";
}

@if (User.Identity.IsAuthenticated)
{
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            @using (Html.BeginForm("Delete", "Stories", FormMethod.Post, new { @class = "navbar-form navbar-left" }))
            {
                @Html.AntiForgeryToken()
                @Html.HiddenFor(model => model.Id)
                
                <a href="@Url.Action("Edit", "Stories", new { Model.Id })" class="btn btn-default">
                    <i class="glyphicon glyphicon-pencil"></i>
                    <span class="hidden-xs">@BiebResources.SharedStrings.Edit</span>
                </a>
                
                <button class="btn btn-default" type="submit" onclick="return confirm('@BiebResources.SharedStrings.SimpleConfirmQuestion')">
                    <i class="glyphicon glyphicon-trash"></i>
                    <span class="hidden-xs">@BiebResources.SharedStrings.Delete</span>
                </button>
            }
        </div>
    </nav>
}

<div class="row">

    <div class="col-md-4">
        @{ Html.RenderPartial("Card", Model); }
    </div>

    <div class="col-md-8">
        @if (Model.Authors.Any())
        {
            <h4>@BiebResources.SharedStrings.Authors</h4>
            <ul>
            @foreach (var person in Model.Authors)
            {
                <li>@Html.ActionLink(person.Text, "Details", new { controller = "people", id = person.Id })</li>
            }
            </ul>
        }

        @if (Model.Translators.Any())
        {
            <h4>@BiebResources.SharedStrings.Translators</h4>
            <ul>
            @foreach (var person in Model.Translators)
            {
                <li>@Html.ActionLink(person.Text, "Details", new { controller = "people", id = person.Id })</li>
            }
            </ul>
        }
        
        @if (Model.SiblingStories.Any())
        {
            <h4>@BiebResources.StoryStrings.Siblings</h4>
            <ul>
            @foreach (var story in Model.SiblingStories)
            {
                <li>@Html.ActionLink(story.Text, "Details", new { controller = "Stories", id = story.Id })</li>
            }
            </ul>
        }
    </div>

</div>